package cn.edu.hunau.java.week02.day05;

import org.junit.Test;

import java.util.Arrays;

public class StringTest {
    @Test
    public void testString(){
        String url="www.hunau.edu.cn/xky/index.html?query=计科&keyword=web";
        int index=url.indexOf("/");
        String host=url.substring(0,index);
        System.out.println(host);

        int indexQuery=url.indexOf("?");
        String queryString=url.substring(indexQuery+1);
        System.out.println(queryString);
        String[] kvs=queryString.split("&");
        System.out.println(Arrays.toString(kvs));
    }
}
